#ifndef __colorpanel_h__
#define __colorpanel_h__

#include "ofMain.h"

#define COLPAN_FREE 0
#define COLPAN_TOUCHED 1

class colorpanel
{
    public:
        colorpanel();
        ~colorpanel();

		void setup(int x, int y, int w, int h, int cid);
		void draw();
		
//		int w, h, alpha, x, y, colorId;
};

class imgpanel: public ofImage{
public:
	
	void drawimg(){
			if(state == COLPAN_FREE)
				ofSetColor(255, 255,0, 255);
			else
				ofSetColor(255, 0,0, 255);

			this->draw(x,y,40,40);
			ofSetColor(255, 255,255, 255);

	}

	void setpos(int _x, int _y){
		x=_x;
		y=_y;
	}

bool check(ofPoint hand)
{	
  	state = COLPAN_FREE;
	bool in = (hand.x < x+40)&&(hand.x > x)&&(hand.y < y+40)&&(hand.y > y);

	if (in)
  		state = COLPAN_TOUCHED;

	return state;
}

	bool state;
	int x, y;
protected:
	
};
#endif

